// public 修饰符：所有地方都能访问
// private 修饰符：只有本类的花括号内能访问
// protected 修饰符：本类的花括号和子类的花括号能访问


class Animal {
    private name: string
    constructor(name: string) {
        this.name = name
    }
    sayName() {
        console.log("my name is ", this.name);
    }
}

class Dog extends Animal {
    static age: number = 1
    constructor(name: string) {
        super(name);  // super() 调用父类的构造函数
    }
    run() { 
        console.log("狗在跑")
     }
}

new Dog("摩卡").sayName()
new Dog("摩卡").run()
// new Dog("摩卡").age
Dog.age